home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / actlib13.zip / STRINGS.ZIP / RMCHR.C < prev    next >
Text File  |  1993-01-14  |  667b  |  29 lines

  1. /*  Copyright (C) 1993   Marc Stern  (internet: stern@mble.philips.be)  */
  2.  
  3. #include "strings.h"
  4.  
  5. /***
  6.  *  Function    :  strrmchr
  7.  *
  8.  *  Description :  Removing all occurences of a target character.
  9.  *
  10.  *  Parameters  :  in/out   char  *string
  11.  *                 in       char  target     target char to remove
  12.  *
  13.  *  Return code :  pointer to result.
  14.  *
  15.  *  OS/Compiler :  All
  16.  ***/
  17.  
  18. char *strrmchr( char *string, char target )
  19.  
  20. { char *ptr, *str_begin = string;
  21.  
  22.   for ( ptr = string; *string; string ++ )
  23.       if ( *string != target ) *ptr++ = *string;
  24.  
  25.   *ptr = '\0';
  26.  
  27.   return str_begin;
  28. }
  29.